#!/bin/bash

> result.txt
sed -i '67s/.*/injection_rate = 0.001;/' mesh88_lat

sed -i 's/injection_rate = 0.001/injection_rate = 0.002/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.002/injection_rate = 0.003/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.003/injection_rate = 0.004/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.004/injection_rate = 0.005/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.005/injection_rate = 0.006/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.006/injection_rate = 0.007/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.007/injection_rate = 0.008/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.008/injection_rate = 0.009/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.009/injection_rate = 0.01/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.01/injection_rate = 0.011/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.011/injection_rate = 0.012/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.012/injection_rate = 0.013/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.013/injection_rate = 0.014/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.014/injection_rate = 0.015/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.015/injection_rate = 0.016/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.016/injection_rate = 0.017/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.017/injection_rate = 0.018/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.018/injection_rate = 0.019/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt

sed -i 's/injection_rate = 0.019/injection_rate = 0.02/g' mesh88_lat
cd ../..
cd src
./booksim ~/booksim2/toturial/0.inj_latnecy_curve/mesh88_lat > ../toturial/0.inj_latnecy_curve/current_out.txt
cd ~/booksim2/toturial/0.inj_latnecy_curve
sed -n '/Final Packet latency average = /'p current_out.txt >> result.txt